﻿#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>


//编写代码将13二进制序列的第5位修改为1，然后再改回0

//int main()
//{
//	int a = 13;
//	int n = 5;
//	//00000000000000000000000000001101
//	//00000000000000000000000000000001         1
//	//00000000000000000000000000010000        1 << (n-1)
//	a = a | (1 << (n - 1));
//	//00000000000000000000000000011101        |
//	printf("%d\n", a);
//	//00000000000000000000000000011101
//	//11111111111111111111111111101111     ~   00000000000000000000000000010000           
//	a &= ~(1 << (n - 1));
//	//00000000000000000000000000001101
//	printf("%d\n", a);
//	return 0;
//}


//逗号表达式，从左向右依次执⾏。整个表达式的结果是最后⼀个表达式的结果。

 //代码1
//int a = 1;
//int b = 2;
//int c = (a > b, a = b + 10, a, b = a + 1);
//逗号表达式
//C是多少呢

//代码2
//while (a = get_val(), count_val(a), a > 0)
//{
//
//}


//结构体
//描述⼀个学⽣需要名字、年龄、学号、身高、体重等；
//结构体成员的直接访问是通过点操作符（.）访问的。点操作符接受两个操作数
struct student
{
	char name[20];  //名字
	int age;//年龄
	double height;
	double weight;
}s3 = { "和天下",30,178.0,66.0 };//全局变量

int main()
{
	struct student s1 = { "张三",18,180.0,70.0 };//局部变量
	struct student s2 = { "李四",20,166.0,50.0 };//局部变量

	printf("%s %d %lf %lf\n", s1.name, s1.age, s1.height, s1.weight);
	printf("%s %d %lf %lf\n", s2.name, s2.age, s2.height, s2.weight);
	printf("%s %d %.2lf %.2lf\n", s3.name, s3.age, s3.height, s3.weight);

	return 0;
}